package com.airlines.crewassignment.service.ruleverification;

import java.util.List;

import org.joda.time.DateTime;

import com.airlines.common.Page;
import com.airlines.crewassignment.entity.ruleverification.RuleVerification;
import com.airlines.crewassignment.entity.ruleverification.RuleVerificationSummary;

/**
 * @author xxxx
 * @date 2018/05/07 16:15:34
 * @company xxxx Airlines
 * @description 规则验证
 */
public interface RuleVerificationService {

    /**
     * 添加 （返回主键ID）
     * @param ruleVerification
     * @return
     */
    int insert(RuleVerification ruleVerification);

    /**
     * 批量插入
     * @param ruleVerifications
     * @return
     */
    boolean batchInsert(List<RuleVerification> ruleVerifications);

    /**
     * 逻辑删除（将is_delete 标记为置为 1）
     * @param id
     * @return
     */
    int deleteLogic(Integer id);


    /**
     * 修改
     * @param ruleVerification
     * @return
     */
    int update(RuleVerification ruleVerification);


    /**
     * 通过主键查询
     * @param id
     * @return
     */
     RuleVerification get(Integer id);

    /**
     * 多条件查询
     * @param ruleVerification
     * @return
     */
    List<RuleVerification> list(RuleVerification ruleVerification);

    /**
     * 多条件模糊查询
     * @param ruleVerification
     * @param page
     * @return
     */
    Page list(RuleVerification ruleVerification, Page page);

    /**
     * 根据日期逻辑删除检查结果，包含 beginDate
     * @param beginDate
     */
    void deleteLogicByAfterDate(DateTime beginDate);

    /**
     * 删除当前的检查结果
     * @param date
     */
	void deleteLogicByDate(DateTime flightDateStart,DateTime flightDateEnd,String dutyCode);
	/**
	 * 检查和保存飞行员排班结果
	 * @param flightDateStart
	 * @param flightDateEnd
	 */
	void checkAndSaveAssignmentF(DateTime flightDateStart,DateTime flightDateEnd);
	
	/**
	 * 查询某一段时间内的检查结果汇总信息
	 * @param flightDateStart
	 * @param flightDateEnd
	 * @param dutyCode
	 * @param workcode
	 * @return
	 */
	List<RuleVerificationSummary> listRuleVerificationSummary(DateTime flightDateStart,DateTime flightDateEnd,String dutyCode,String workcode);
}
